#ifndef _GAME_EVENT_H_
#define _GAME_EVENT_H_

#include <Game/Game.h>

namespace pp
{
    static const std::string GAME_EVENT_NAME = "GameEvent";

    static const uint32_t GAME_TICK_EVENT_ID = 0x1;
    static const uint32_t GAME_EXIT_EVENT_ID = 0xFFFFFFFF;

    class GameEvent : public ne::Event
    {
        public:
            explicit GameEvent(const uint32_t id)
                : ne::Event(GAME_EVENT_NAME),
                  ID(id)
            {
            }

            GameEvent(const GameEvent &e)
                : ne::Event(e),
                  ID(e.ID)
            {
            }

            GameEvent& operator = (const GameEvent &e)
            {
                ne::Event::operator = (e);
                ID = e.ID;
                return *this;
            }

            virtual ~GameEvent()
            {
            }

        private:
            GameEvent();

        public:
            uint32_t ID;
    };

    class GameTickEvent : public GameEvent
    {
        public:
            GameTickEvent()
                : GameEvent(GAME_TICK_EVENT_ID),
                  interval(0)
            {
            }

            GameTickEvent(const GameTickEvent &e)
                : GameEvent(e),
                  interval(e.interval)
            {
            }

            GameTickEvent& operator = (const GameTickEvent &e)
            {
                GameEvent::operator = (e);
                interval = e.interval;
                return *this;
            }

        public:
            ne::real interval;
    };

    class GameExitEvent : public GameEvent
    {
        public:
            GameExitEvent()
                : GameEvent(GAME_EXIT_EVENT_ID)
            {
            }
    };

}

#endif
